<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<div class="right_content">
	<h2 style="margin-top: 0px">Promotion Management</h2>
	<s:if test="%{#request.error != null}">
		<div style="color: #f00;"> <s:property value="#request.error" /> </div>
		<br/>
	</s:if>
	<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
		<thead>
			<tr>
				<th scope="col" class="rounded">N.O</th>
				<th scope="col" class="rounded">Name</th>
				<th scope="col" class="rounded">Photo</th>
				<th scope="col" class="rounded">Enable</th>
				<th scope="col" class="rounded">Edit</th>
				<th scope="col" class="rounded-q4">Delete</th>
			</tr>
		</thead>
		<tfoot>
		</tfoot>
		<tbody style="text-align: center">
		<s:iterator status="promotion" value="#request.promotions">
			<tr>
				<td><s:property value="#promotion.index" /></td>
				<td><s:property value="getName()" /></td>
				<td><img src="<s:property value="%{'../' + getImageUrl()}" />"/></td>
				<td>
					<s:if test="%{isEnable() == true}">
              		<input type="checkbox" checked="checked" disabled="disabled"/>
              	</s:if>
              	<s:else>
              		<input type="checkbox" disabled="disabled"/>
              	</s:else>
				</td>
				<td><a href=" <s:url action="promotionlist"> <s:param name="action">edit</s:param><s:param name="id" value="getId()" /></s:url>"><img src="<s:url value="/css/admin/images/user_edit.png"/>" alt="" title="" border="0" /></a></td>
              	<td><a href="#" class="ask"><img src="<s:url value="/css/admin/images/trash.png"/>" alt="<s:property value="getId()" />" 
              	title="" border="0" onclick="confirmDelete('/promotionlist?action=delete&idcart=' + this.alt)" /></a></td>
			</tr>
			</s:iterator>
		</tbody>
	</table>
	<div class="pagination">
			<span class="disabled"><< prev</span>
			<span class="current">1</span>
			<span class="disabled">next >></span>
		</div>
	<h2>&nbsp;</h2>
</div>